﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理员-登录</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="~/lib/jquery-3.4.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Login").click(function () {
                name = $("#Name").val();
                password = $("#Password").val();
                if (name == ''||password =='') { alert("账号名称或密码不能为空！"); return false; }
                $.ajax({
                    type: "post",
                    url: "/Admin/AdminLogin",
                    data:"name="+name+"&password="+password,
                    success: function (message) {
                        if (message.returnCode == "001") {
                            alert("登录成功");
                            location.href = "/Admin/GetApplicantList";
    }
    else if (message.returnCode == "999")
        alert("登录失败！账号名称或密码错误！");
}
});
});
});
    </script>
</head>
<body>
    <div style="margin-top: 150px;">
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-4 column">
                </div>
                <div class="col-md-4 column">
                    <form role="form">
                        <div class="form-group">
                            <label for="exampleInputEmail1">账号名称</label>
                            <input type="text" class="form-control" id="Name" required />
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">密码</label>
                            <input type="password" class="form-control" id="Password" />
                        </div>
                        <button type="button" id="Login" class="btn btn-default btn-info btn-block">登录</button>
                    </form>
                </div>
                <div class="col-md-4 column">
                </div>
            </div>
        </div>
    </div>
</body>
</html>

